import { defineEventHandler, readBody } from 'h3';

export default defineEventHandler(async (event) => {
  const body = await readBody(event);

  const { toState, context: _context } = body;

  // 模拟状态转换
  const result = {
    success: true,
    newState: toState,
  };

  return {
    code: 0,
    data: result,
    message: '状态转换成功',
  };
});
